package com.wtgroup.demo.leetcode.org_bytedance;

public class Q_最长连续递增序列 {
    public static void main(String[] args) {
        int[] nums = {2, 1, 3};
        Q_最长连续递增序列 exe = new Q_最长连续递增序列();
        System.out.println(exe.findLengthOfLCIS(nums));
    }

    public int findLengthOfLCIS(int[] nums) {
        int n = nums.length;
        int ans = 0;
        for (int i = 0; i < n;) {
            int j = i+1;
            while (j < n && nums[j] > nums[j - 1]) {j++;}
            ans = Math.max(ans, j - i);
            i = j;
        }

        return ans;
    }

}
